local pishi = fk.CreateSkill{
  name = "hanqing__pishi",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["hanqing__pishi"] = "披矢",
  [":hanqing__pishi"] = "锁定技，当你成为伤害牌的目标时，若你武将牌上没有与之同名的牌，你将此牌置于武将牌上并取消之。",
}

pishi:addEffect(fk.TargetConfirming, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(pishi.name) and
      data.card.is_damage_card and
      not table.find(player:getPile(pishi.name), function (id)
        return Fk:getCardById(id).trueName == data.card.trueName
      end) and
      player.room:getCardArea(data.card) == Card.Processing
  end,
  on_use = function(self, event, target, player, data)
    data:cancelTarget(player)
    player:addToPile(pishi.name, data.card, true, pishi.name, player)
  end,
})

return pishi
